package com.way.demo.service.impl;

import com.way.demo.comm.UserInfo;
import com.way.demo.service.TestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lipingwei
 * @create 2021-01-22 10:52
 */
@Service("testServiceImpl")
@Transactional
public class TestServiceImpl implements TestService {
    @Override
    public UserInfo queryUserById(String token, String source) {
        UserInfo userInfo = new UserInfo();
        if("0".equals(source)){
            //开发联调；测试;不用验证token
            userInfo.setUserName("zhangsan")
                    .setGender("1")
                    .setDeptNo("001")
                    .setTel("1234567890");


        }else if("1".equals(source)){
            //验证token
            userInfo.setUserName("lisi")
                    .setGender("2")
                    .setDeptNo("002")
                    .setTel("0987654321");
        }
        return userInfo;
    }
}
